<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="DC.Type" content="task"/>
<meta name="DC.Title" content="Adding new string arrays"/>
<meta name="abstract" content="Create a new string array resource using the Localization Files Editor."/>
<meta name="description" content="Create a new string array resource using the Localization Files Editor."/>
<meta name="DC.Relation" scheme="URI" content="../topics/t_localize-about.html"/>
<meta name="DC.Relation" scheme="URI" content="http://developer.android.com/guide/topics/resources/localization.html#resource-precedence"/>
<meta name="DC.Relation" scheme="URI" content="../topics/r_localization-string-editor.html"/>
<meta name="DC.Relation" scheme="URI" content="../topics/t_localize-new-string-adding.html"/>
<meta name="DC.Relation" scheme="URI" content="../topics/t_localize-array-editing.html"/>
<meta name="copyright" content="Motorola Mobility, Inc. 2009-2011" type="primary"/>
<meta name="DC.Rights.Owner" content="Motorola Mobility, Inc. 2009-2011" type="primary"/>
<meta name="DC.Format" content="XHTML"/>
<meta name="DC.Identifier" content="t_localize-new-array-adding"/>
<meta name="DC.Language" content="en-us"/>
<link rel="stylesheet" type="text/css" href="../commonltr.css"/>
<title>Adding new string arrays</title>
</head>
<body id="t_localize-new-array-adding"><a name="t_localize-new-array-adding"><!-- --></a>
<a class="hdr-none"/>

  <h1 class="topictitle1">Adding new string arrays</h1>

  
  
  <div><p>Create a new string array resource using the Localization Files Editor.</p>

    <ol>
      <li>
        <span>Launch the Localization Files Editor using one of the following methods:</span>
        <ul>
          <li>Double-click <span class="filepath">res/values/strings.xml</span> (or any of the localized <span class="filepath">strings.xml</span> files in your project).</li>

          <li>Right-click <span class="filepath">res/values/strings.xml</span> (or any of the localized <span class="filepath">strings.xml</span> files in your project) and select <span class="menucascade"><span class="uicontrol">Open
                With</span> &gt; <span class="uicontrol">Other</span></span>. From the Editor Selection dialog, select
              <span class="uicontrol">Localization Files Editor</span> and click OK.</li>

        </ul>

         The Localization Files Editor appears, showing the base (or default) strings file and any localized
          strings files.
      </li>

      <li>
        <span>Click <img src="../images/loc_editor-add-array-button.png"/> (located immediately above the Localization
          Files Editor table).</span>
          A new array with a single entry is added to the table, and the default key value is highlighted.
          Note that a warning icon (<img src="../images/localization-warning-icon.png"/>) appears next to the key,
          indicating that the default strings file does not yet have a value defined for the key and index that identify
          the single array entry. 
      </li>

      <li>
        <span>Enter the key that will be used to access the new string array, replacing the default value that was
          generated when the new array was created.</span>
      </li>

      <li>
        <span>Click the disclosure triangle below and to the left of the array key to expose the array's entries.</span>
      </li>

      <li>
        <span>Enter string values for the row in the appropriate columns. Generally you will enter a default, or base,
          string in the <span class="uicontrol">values</span> column and localized versions of that string in columns for those
          locales in which the default string is not appropriate. Note that you can enter multi-line string values by
          pressing the Return key between lines.</span>
      </li>

      <li>
        <span>With an of the array's rows selected, add additional array entries by clicking <img src="../images/loc_editor-add-array-item-button.png"/> once for each entry, or by clicking the
          downward-pointing arrow to the right of this action and specifying the number of entries to be added.</span>
         The new entry or entries are added to the end of the array. Fill in the string values for each new
          row in the appropriate columns as in the previous step.
      </li>

      <li>
        <span>Select <span class="menucascade"><span class="uicontrol">File</span> &gt; <span class="uicontrol">Save</span></span> to save your
          changes.</span>
      </li>

    </ol>

    <div class="section">To remove an individual array entry simply click within the row to select it and then click <img src="../images/loc_editor-remove-line-button.png"/>. To remove an entire string array, click the table row that
      contains the array's key and then click <img src="../images/loc_editor-remove-line-button.png"/>.</div>

  </div>

<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="../topics/t_localize-about.html" title="Using the Localization Files Editor, you can easily create text string files for new locales, see which strings will be used in a given locale, and identify strings that have yet to be translated, all without having to work directly in XML-formatted files. It makes it easy to add new strings across multiple locales, and edit localized strings.">Localizing Text Strings</a></div>
</div>
<div class="relinfo"><strong>Related tasks</strong><br/>
<div><a href="../topics/t_localize-new-string-adding.html" title="Create a new string using the Localization Files Editor by adding a new row.">Adding new strings</a></div>
<div><a href="../topics/t_localize-array-editing.html" title="Use the Localization Files Editor to create localized versions of text string arrays used in your applications.">Editing a localized string array</a></div>
</div>
<div class="relinfo"><strong>Related reference</strong><br/>
<div><a href="../topics/r_localization-string-editor.html" title="Allows you to easily create text string files for new locales, to see which strings will be used in a given locale, and to identify strings that have yet to be translated, all without having to work directly in XML-formatted files.">Localization Files Editor</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br/>
<div><a href="http://developer.android.com/guide/topics/resources/localization.html#resource-precedence" target="_blank">Which Resources Take Precedence?</a></div>
</div>
</div>

</body>
</html>